unit EntryDlg;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TfmEntryDlg = class(TForm)
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

procedure TfmEntryDlg.FormShow(Sender: TObject);
var lst: TList;
begin
  lst := TList.Create;
  GetTabOrderList(lst);
  TWinControl(lst[0]).SetFocus;
end;

procedure TfmEntryDlg.FormKeyPress(Sender: TObject; var Key: Char);
begin
  case Ord(Key) of
    VK_RETURN: begin
      FindNextControl(ActiveControl, True, True, False).SetFocus;
      Key := #0;
    end;
    VK_ESCAPE: Close;
  end;

end;

end.
